home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9541 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: argc/argv & switches
  5. Date: 9 Mar 96 23:45:48 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.826415148@rscernix>
  8. References: <4h2j8j$9gn@milo.freenet.vancouver.bc.ca> <danpop.825593142@rscernix> <313E0094.167EB0E7@fore.com> <4hl52oINNa4l@anvil.ugrad.cs.ubc.ca> <danpop.826238070@rscernix> <4ho9dv$bcb@castle.nando.net>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <4ho9dv$bcb@castle.nando.net> actuary@nando.net   (Bill McCarthy) writes:
  13.  
  14. >While we're on the standard, Dan, is the "missing period" contained on
  15. >page 26 (6.1.3.1)?
  16.  
  17. Dunno.  I don't have _any_ book with Schildt's name on the cover, not
  18. even this one.  The missing period was discussed some time ago on
  19. comp.std.c, when someone thought he found a mistake in the standard,
  20. but it turned out that it was a mistake in the book (one of the few
  21. which are not imputable to Schildt).
  22.  
  23. >And (2), negative numbers cannot be doubles?  From experience,
  24. >this appears wrong.  But the only sign I see in the syntax is in the
  25. >exponent-part.
  26.  
  27. This is correct.  An integer or floating point constant doesn't include
  28. the sign.  When you write -1.23 you have a constant expression: the
  29. unary minus operator applied to the 1.23 constant.  
  30.  
  31. In most cases, this is transparent, but there is one exception:
  32. consider an implementation with INT_MAX = 32767 and INT_MIN = -32768.
  33. If you write -32768, the type of this constant expression is _long_,
  34. because 32768 cannot be represented as int.  So, if you need this value
  35. with the type int, you have to write it as (-32767 - 1).  Well, normally
  36. you can simply use INT_MIN instead, but somewhere in <limits.h> INT_MIN
  37. itself has to be defined somehow and this is how it is usually defined,
  38. either explicitly or as (-INT_MAX - 1).
  39.  
  40. Dan
  41. --
  42. Dan Pop
  43. CERN, CN Division
  44. Email: danpop@mail.cern.ch 
  45. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  46.